package org.example.service.impl;

import org.example.model.Student;
import org.example.model.Teacher;
import org.example.repository.TeacherRepository;
import org.example.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * Description:TODO 详细描述
 * <p>
 * Copyright: 天津联想协同科技有限公司
 * <p>
 *
 * @author anlu
 * @date 2021/9/13 15:44
 */
@Service
public class TeacherServiceImpl implements TeacherService {

    @Autowired
    private TeacherRepository teacherRepository;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void addTeacher(Teacher teacher) {
        teacherRepository.save(teacher);
    }
}
